package com.simple.datax.bo.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.simple.datax.bo.IDataxFlowActivityTemplateBO;
import com.simple.datax.dao.IDataxFlowActivityTemplateDAO;
import com.simple.datax.vo.DataxFlowActivityTemplateIdVO;
import com.simple.datax.vo.DataxFlowActivityTemplateVO;

@Service("dataxFlowActivityTemplateBO")
@Transactional(propagation=Propagation.REQUIRED,readOnly=true)
public class DataxFlowActivityTemplateBOImpl implements IDataxFlowActivityTemplateBO {

	@Autowired
	private IDataxFlowActivityTemplateDAO dataxFlowActivityTemplateDAO;
	
	@Override
	public List<DataxFlowActivityTemplateVO> findAll() {
		return dataxFlowActivityTemplateDAO.findAll();
	}

	@Override
	@Transactional(propagation=Propagation.REQUIRED,readOnly=false,rollbackFor={Exception.class})
	public void add(DataxFlowActivityTemplateVO dataxFlowActivityTemplateVO) {
		dataxFlowActivityTemplateDAO.saveOrUpdate(dataxFlowActivityTemplateVO);
	}
	
	@Override
	@Transactional(propagation=Propagation.REQUIRED,readOnly=false,rollbackFor={Exception.class})
	public void del(DataxFlowActivityTemplateIdVO id) {
		dataxFlowActivityTemplateDAO.delete(id);
	}

	@Override
	public DataxFlowActivityTemplateVO findById(DataxFlowActivityTemplateIdVO id) {
		return dataxFlowActivityTemplateDAO.findById(id);
	}

	@Override
	public Integer generateId() {
		return dataxFlowActivityTemplateDAO.generateId();
	}

	@Override
	@Transactional(propagation=Propagation.REQUIRED,readOnly=false,rollbackFor={Exception.class})
	public void addBatch(List<DataxFlowActivityTemplateVO> dataxFlowActivityTemplateVOs) {
		dataxFlowActivityTemplateDAO.addBatch(dataxFlowActivityTemplateVOs);
	}

	@Override
	public List<DataxFlowActivityTemplateVO> findByFlowTempId(String flowTempId) {
		return dataxFlowActivityTemplateDAO.findByFlowTempId(flowTempId);
	}

}
